<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./lib/layui/css/layui.css">
</head>

<body>
  <div class="layui-container">
    <div class="layui-row">
      <div class="layui-col-md6 layui-col-sm3">111</div>
      <div class="layui-col-md6 layui-col-sm3">222</div>
      <div class="layui-col-md6 layui-col-sm3">333</div>
      <div class="layui-col-md6 layui-col-sm3">444</div>
    </div>
    <button class="layui-btn layui-btn-success layui-btn-lg">按钮</button>
    <div id="rate"></div>
  </div>
  <script src="./lib/layui/layui.js"></script>
  <script>
    layui.use(['rate', 'jquery'], function () {
      var rate = layui.rate;
      var $ = layui.jquery;

      $(function(){
        alert(1)
      })
      //渲染评分
      var ins1 = rate.render({
        elem: '#rate',  //绑定元素
        length: 10,
        value: 8,
        choose: function (value) {
         console.log(value);
        }
      });
    })
  </script>
</body>

</html>